﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Webitel.Controls
{
	/// <summary>
	/// Логика взаимодействия для CheckBox.xaml
	/// </summary>
	public partial class CheckBox : UserControl
	{
		public CheckBox()
		{
			InitializeComponent();
			Checked = false;
		}

		bool _checked;

		public bool Checked
		{
			set 
			{ 
				_checked = value;
				if (value)
				{
					Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x54, 0x32, 0x46));
				}
				else
				{
					Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x14, 0x32, 0x46));					
				}
			}
			get { return _checked; }
		}

		public string Text
		{
			set { tbText.Text = value; }
			get { return tbText.Text; }
		}

		public void OnCheck() 
		{
			Checked = !Checked;
		}
	}
}
